import React from 'react'
// ===================================================================== Temp
import FormModal from '#cpt/temp/FormModal'
// ===================================================================== global declare
const { $fn } = window
// ===================================================================== Lazy
// ===================================================================== component
class Index extends React.Component{
	state = {
		// 提交表单列表
		formData : [
			{ label: '是否同步',			name: 'temp_update', 	full:true,		type: 'checkbox', },
			{ label: '最低温度',			name: 'start_temp', 	half:true,		type: 'number', required:true, max: 10 },
			{ label: '最高温度',			name: 'end_temp', 		half:true,		type: 'number', max: 10 },
		]
	}
	
	open = (param, bol) => {
		this.modal.open({ formRef: this.formRef })
		this.submit = param
		const { formData } = this.state
		$fn.hideRows(formData, ['temp_update'], bol)
		this.setState({ formData })
	}
	
	render(){
		const { api } = this.props
		return FormModal.call(this,{ title: '设置温度', labelWidth:'s4', width:600, clear:true, api})
	}
}

export default Index